<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta name="author" content="lushu">
		<title>卡消费明细</title>
		<script type="text/javascript" language="javascript" src="../script/common.js"></script>
		<script language="javascript" src="../script/common_stat.js" type="text/javascript"></script>
		<script type="text/javascript" language="javascript">
			//自定义了页面时间类型的select元素
			//如果重新定义date_type，可以考虑把这个类型加进去
			var DATE_TYPE=[{text:"交易时间",code:1},
							{text:"业务日期",code:3},
							{text:"入帐时间",code:2}];
			
			var Page;
			function initPageElements(){
				Page.sql = "clear_consume_list";
				//ListPage.allowNullTradeType(TX.SUBTYPE.CONSUME);
				Page.selection.tradeType={list:Common.getSubsetItems("trade_type",TX.SUBTYPE.CONSUME)};
				ListPage.allowNullTradeStatus(TX.STATUS.CONSUME);
				Page.selection.dateType = {list:DATE_TYPE,defText:"交易时间"};
				Page.selection.accountType = {list:Clear.AccountType.consume()};
				Page.preSubmit = function(v){
					if (v.tradeType == Constants.TRADE_TYPE_BANK_CONSUME 
							|| v.tradeType == Constants.TRADE_TYPE_CASH_CONSUME)
						v.accountType = "";
				}
				Common.initDict(searchForm.giftId,"gift_item","全 部")
			}
			
			function changeTradeType(obj){
				var type;
				if (obj)
					type = obj.value;
				if (type == Constants.TRADE_TYPE_CARD_CONSUME)
					Page.form.accountType.disabled = false;
				else{
					Page.form.accountType.selectedIndex = 0;
					Page.form.accountType.disabled = true;
				}
				Clear.changeTradeType(obj);
			}
		</script>
	</head>
	<body onload="Clear.List.init()" >
		<div class="nav"><div id="nav">&nbsp;</div></div>
		<div id="listView" >	
			<div class="searchForm">
				<form id="searchForm" name="searchForm">
					<table cellSpacing="0" cellPadding="4" width="100%" border="0">
						<tr>
							<td class="label6" id="org"></td>
							<td class="label7">
								<label>交易类型</label>
								<select name="tradeType" onchange="changeTradeType(this)"><option></option></select>
							</td>
							<td class="label5">
							<!--  zhbus-project 页面 -->
								<label>IC卡号</label> 
								<input name="cardAsn" maxlength=20>
							</td>
						</tr>
						<tr>
							<td class="label6">
								<label>交易状态</label> 
								<select name="tradeStatus"><option></select>
							</td>
							<td class="label7">
								<label>帐户类型</label> 
								<select name="accountType" onchange="ListPage.changeAccountCode(this)"><option></select>
							</td>
							<td class="label5">
								<label>EFT 编号</label> 
								<input type="text" name="eftNo" value="" onblur="checkV(this,'long')">
							</td>
						</tr>
						<tr>
							<td class="label6" id="beginDateTd"></td>	
							<td class="label7" id="endDateTd"></td>
							<td class="label5">
								<label>时间类型</label> 
								<select name="dateType"><option></select>
							</td>
						</tr>
						<tr>
							<td class="label6" id="minAmountTd"></td>
							<td class="label7" id="maxAmountTd"></td>
							<td class="label5"><label>商品名称</label> <select name="giftId"></select></td>
							<td><button onclick="ListPage.showListTable()">查 询</button></td>
						</tr>
					</table>
				</form>
			</div>
			<div id="datalist"></div>
		</div>
		<div id="detailView" style="display:none;">
			<div id="printArea">
				<div class="listBorder">
					<div class="formTitle">消费交易明细</div>
					<div id="mainTrade"></div>
				</div>
				<div class="form" id="subTradesDiv" style="display:none;">
					<div class="formTitle">
						<span id="subTradesTitle"></span>
					</div>
					<div id="subTradesList"></div>
				</div>
			</div>
			<p>
				<button onclick="WebPrint.preview('printArea')">打印预览</button>
				<button onclick="WebPrint.print('printArea')">打印</button>
				<button onclick="switchPage('listView')">返 回</button>
			</p>
		</div>
	</body>
</html>